<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://xmlns.jcp.org/jsf/html"
      xmlns:ui="http://xmlns.jcp.org/jsf/facelets"
      xmlns:p="http://primefaces.org/ui"
      xmlns:f="http://xmlns.jcp.org/jsf/core">
    <h:head>
        <title>Facelet Title</title>
    </h:head>
    <h:body>
        <ui:composition template="mainlayout.xhtml">
            <ui:define name="content">
                <h:form>
                    <p:panel>
                        <f:facet name="header">
                            <h:panelGroup style="display: block; text-align:center">
                                <h:outputText value="Search user:"/>
                            </h:panelGroup>
                        </f:facet>

                        <p:selectManyMenu id="ad" style="width:100%" value="#{searchView.searched}" var="u" filter="true" filterMatchMode="contains" showCheckbox="false">
                            <f:selectItems value="#{searchView.searchable}" var="user" itemLabel="#{user.username}" itemValue="#{user}" />
                            <p:column>
                                <h:outputText value="#{u.username}"/>
                            </p:column>
                            <p:ajax update="aa"/>
                        </p:selectManyMenu>
                        <p:separator />
                        <h:panelGroup style="display:block; text-align:center">
                            <p:commandButton id="aa" action="#{searchView.goUserProfile()}" value="See profile" />
                        </h:panelGroup>

                    </p:panel>



                </h:form>
            </ui:define>
        </ui:composition>
    </h:body>
</html>

